package com.jhg.drgclinicalpathway.controller;

import com.jhg.drgclinicalpathway.dao.QingdanDao;
import com.jhg.drgclinicalpathway.domain.RpnMsg;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api("医保结算清单类")
@RestController
@RequestMapping("yb")
@Slf4j(topic = "QingdanController")
public class QingdanController {
    @Autowired
    QingdanDao qddao;
    @PostMapping("YBJSQD")
    public RpnMsg getQD(@RequestBody Map<String,Object> map) {
        int lb =(int) map.get("lb");
        RpnMsg rpnMsg=null;
        String jzh = map.get("jzh").toString();
        if(jzh!=null&&jzh.length()>0) {
            switch (lb) {
                case 1:
                    rpnMsg =  RpnMsg.SUCCESS(qddao.getBrxxByJzh(jzh));
                    break;
                case 2:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getBrZdxxByJzh(jzh));
                    break;
                case 3:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getBrSsxxByJzh(jzh));
                    break;
                case 4:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getBrFyxxByJzh(jzh));
                    break;
                case 5:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getZDFyxxByJzh(jzh));
                    break;
                case 6:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getYbjsjlByJzh(jzh));
                    break;
                case 7:
                    rpnMsg=RpnMsg.SUCCESS(qddao.getQDjyxxByJzh(jzh));
                    break;
                default:
                    rpnMsg = RpnMsg.SUCCESS();
            }
            return rpnMsg;
        } else {
            return RpnMsg.SUCCESS("");
        }
    }
}
